<template>
  <div><button @click="getData()">获取接口数据</button></div>
</template>

<script setup>
import axios from "axios";
import { computed } from "vue";
const getData = () => {
  var api =
    //测试接口
    // "http://www.phonegap100.com/appapi.php?a=getPortalList&catid=20&page=1"//ok
    // "https://api.uomg.com/api/rand.qinghua" //ok
    // 高德地图天气接口
    // "https://restapi.amap.com/v3/config/district" //no
    // "https://restapi.amap.com/v3/weather/weatherInfo?key=5285148bc99580263586c7c226ca1aab&city=110000&extensions=all&output=JSON" //no
    axios
      .get(api)
      .then((res) => {
        console.log(res.data);
      })
      .catch((err) => {
        console.log(err);
      });
};
</script>

<style></style>
